const express = require('express')
const router = express.Router()

//导入路由处理模块
const userinfo_handler = require('../router_handler/userinfo')

//验证数据中间件
const expressJoi = require('@escook/express-joi')
//验证规则对象
const { reg_updateInfo_schema, update_password_schema } = require('../schema/user')

//挂载路由
router.get('/userinfo', userinfo_handler.getUserInfo)
router.post('/userinfo', expressJoi(reg_updateInfo_schema), userinfo_handler.updateUserInfo)
router.post('/updatepwd', expressJoi(update_password_schema), userinfo_handler.updatePassword)
router.get('/alluserinfo', userinfo_handler.getAllUserInfo)
router.post('/deleteuser', userinfo_handler.deleteuser)



module.exports = router